package com.day28;

public class StaticTest {
    int commoniint=0;//普通变量
    static int staticint=0;//静态变量

    StaticTest(int x){
        this.commoniint=x;
    }

    public static void main(String[] args) {
        StaticTest s1=new StaticTest(1);
        StaticTest s2=new StaticTest(2);

        System.out.println("s1.commonint="+s1.commoniint);
        System.out.println("s2.commonint="+s2.commoniint);

        s1.staticint=1;
        System.out.println("s1为staticint赋值为1");
        System.out.println("s1.staticint="+s1.staticint);
        System.out.println("s2.staticint="+s2.staticint);
        System.out.println("s2为staticint赋值为15");
        s2.staticint=15;
        System.out.println("s1.staticint="+s1.staticint);
        System.out.println("s2.staticint="+s2.staticint);
    }
}
